<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>
<body>
	<input type="color">
	<ul>
		<li>1</li>
		<li>2</li>
		<li>3</li>
		<li>4</li>
		<li>5</li>
		<li>6</li>
		<li>7</li>
		<li>8</li>
		<li>9</li>
		<li>10</li>
	</ul>
	<script>
		// Array.from() -- 
		// 1. 将伪数组转为真数组
		// 2. 配合new Array() 批量生成数据
		Array.from(new Array(10),()=>{}) // 参数二可以传一个函数, 函数和map功能类似
	/* const lis =	document.querySelectorAll('li')
	console.log(lis);
	console.log(Array.from(lis)); */
	// const arr = new Array(10)
	// console.log(arr);
/* 	const res = Array.from(new Array(10), (item,index)=> {
		return {name: 'aaa'+index}
	})
	console.log(res); */
	const res = Array.from(new Array(11), (item,index)=> {
		return index + 2021 - 5
	})
	console.log(res);
	</script>
</body>
</html>